package com.hospital.pharmacy.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class PurchaseExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public PurchaseExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        protected void addCriterionForJDBCDate(String condition, Date value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value.getTime()), property);
        }

        protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
            Iterator<Date> iter = values.iterator();
            while (iter.hasNext()) {
                dateList.add(new java.sql.Date(iter.next().getTime()));
            }
            addCriterion(condition, dateList, property);
        }

        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdIsNull() {
            addCriterion("pch_mdc_id is null");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdIsNotNull() {
            addCriterion("pch_mdc_id is not null");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdEqualTo(Integer value) {
            addCriterion("pch_mdc_id =", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdNotEqualTo(Integer value) {
            addCriterion("pch_mdc_id <>", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdGreaterThan(Integer value) {
            addCriterion("pch_mdc_id >", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("pch_mdc_id >=", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdLessThan(Integer value) {
            addCriterion("pch_mdc_id <", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdLessThanOrEqualTo(Integer value) {
            addCriterion("pch_mdc_id <=", value, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdIn(List<Integer> values) {
            addCriterion("pch_mdc_id in", values, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdNotIn(List<Integer> values) {
            addCriterion("pch_mdc_id not in", values, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdBetween(Integer value1, Integer value2) {
            addCriterion("pch_mdc_id between", value1, value2, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchMdcIdNotBetween(Integer value1, Integer value2) {
            addCriterion("pch_mdc_id not between", value1, value2, "pchMdcId");
            return (Criteria) this;
        }

        public Criteria andPchPriceIsNull() {
            addCriterion("pch_price is null");
            return (Criteria) this;
        }

        public Criteria andPchPriceIsNotNull() {
            addCriterion("pch_price is not null");
            return (Criteria) this;
        }

        public Criteria andPchPriceEqualTo(Double value) {
            addCriterion("pch_price =", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceNotEqualTo(Double value) {
            addCriterion("pch_price <>", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceGreaterThan(Double value) {
            addCriterion("pch_price >", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceGreaterThanOrEqualTo(Double value) {
            addCriterion("pch_price >=", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceLessThan(Double value) {
            addCriterion("pch_price <", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceLessThanOrEqualTo(Double value) {
            addCriterion("pch_price <=", value, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceIn(List<Double> values) {
            addCriterion("pch_price in", values, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceNotIn(List<Double> values) {
            addCriterion("pch_price not in", values, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceBetween(Double value1, Double value2) {
            addCriterion("pch_price between", value1, value2, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchPriceNotBetween(Double value1, Double value2) {
            addCriterion("pch_price not between", value1, value2, "pchPrice");
            return (Criteria) this;
        }

        public Criteria andPchCountIsNull() {
            addCriterion("pch_count is null");
            return (Criteria) this;
        }

        public Criteria andPchCountIsNotNull() {
            addCriterion("pch_count is not null");
            return (Criteria) this;
        }

        public Criteria andPchCountEqualTo(Integer value) {
            addCriterion("pch_count =", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountNotEqualTo(Integer value) {
            addCriterion("pch_count <>", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountGreaterThan(Integer value) {
            addCriterion("pch_count >", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountGreaterThanOrEqualTo(Integer value) {
            addCriterion("pch_count >=", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountLessThan(Integer value) {
            addCriterion("pch_count <", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountLessThanOrEqualTo(Integer value) {
            addCriterion("pch_count <=", value, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountIn(List<Integer> values) {
            addCriterion("pch_count in", values, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountNotIn(List<Integer> values) {
            addCriterion("pch_count not in", values, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountBetween(Integer value1, Integer value2) {
            addCriterion("pch_count between", value1, value2, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchCountNotBetween(Integer value1, Integer value2) {
            addCriterion("pch_count not between", value1, value2, "pchCount");
            return (Criteria) this;
        }

        public Criteria andPchTotalIsNull() {
            addCriterion("pch_total is null");
            return (Criteria) this;
        }

        public Criteria andPchTotalIsNotNull() {
            addCriterion("pch_total is not null");
            return (Criteria) this;
        }

        public Criteria andPchTotalEqualTo(Double value) {
            addCriterion("pch_total =", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalNotEqualTo(Double value) {
            addCriterion("pch_total <>", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalGreaterThan(Double value) {
            addCriterion("pch_total >", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalGreaterThanOrEqualTo(Double value) {
            addCriterion("pch_total >=", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalLessThan(Double value) {
            addCriterion("pch_total <", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalLessThanOrEqualTo(Double value) {
            addCriterion("pch_total <=", value, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalIn(List<Double> values) {
            addCriterion("pch_total in", values, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalNotIn(List<Double> values) {
            addCriterion("pch_total not in", values, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalBetween(Double value1, Double value2) {
            addCriterion("pch_total between", value1, value2, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchTotalNotBetween(Double value1, Double value2) {
            addCriterion("pch_total not between", value1, value2, "pchTotal");
            return (Criteria) this;
        }

        public Criteria andPchDateIsNull() {
            addCriterion("pch_date is null");
            return (Criteria) this;
        }

        public Criteria andPchDateIsNotNull() {
            addCriterion("pch_date is not null");
            return (Criteria) this;
        }

        public Criteria andPchDateEqualTo(Date value) {
            addCriterion("pch_date =", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateNotEqualTo(Date value) {
            addCriterion("pch_date <>", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateGreaterThan(Date value) {
            addCriterion("pch_date >", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateGreaterThanOrEqualTo(Date value) {
            addCriterion("pch_date >=", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateLessThan(Date value) {
            addCriterion("pch_date <", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateLessThanOrEqualTo(Date value) {
            addCriterion("pch_date <=", value, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateIn(List<Date> values) {
            addCriterion("pch_date in", values, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateNotIn(List<Date> values) {
            addCriterion("pch_date not in", values, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateBetween(Date value1, Date value2) {
            addCriterion("pch_date between", value1, value2, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchDateNotBetween(Date value1, Date value2) {
            addCriterion("pch_date not between", value1, value2, "pchDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateIsNull() {
            addCriterion("pch_guarantee_date is null");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateIsNotNull() {
            addCriterion("pch_guarantee_date is not null");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateEqualTo(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date =", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateNotEqualTo(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date <>", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateGreaterThan(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date >", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date >=", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateLessThan(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date <", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateLessThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("pch_guarantee_date <=", value, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateIn(List<Date> values) {
            addCriterionForJDBCDate("pch_guarantee_date in", values, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateNotIn(List<Date> values) {
            addCriterionForJDBCDate("pch_guarantee_date not in", values, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("pch_guarantee_date between", value1, value2, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchGuaranteeDateNotBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("pch_guarantee_date not between", value1, value2, "pchGuaranteeDate");
            return (Criteria) this;
        }

        public Criteria andPchRemarkIsNull() {
            addCriterion("pch_remark is null");
            return (Criteria) this;
        }

        public Criteria andPchRemarkIsNotNull() {
            addCriterion("pch_remark is not null");
            return (Criteria) this;
        }

        public Criteria andPchRemarkEqualTo(String value) {
            addCriterion("pch_remark =", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkNotEqualTo(String value) {
            addCriterion("pch_remark <>", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkGreaterThan(String value) {
            addCriterion("pch_remark >", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkGreaterThanOrEqualTo(String value) {
            addCriterion("pch_remark >=", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkLessThan(String value) {
            addCriterion("pch_remark <", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkLessThanOrEqualTo(String value) {
            addCriterion("pch_remark <=", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkLike(String value) {
            addCriterion("pch_remark like", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkNotLike(String value) {
            addCriterion("pch_remark not like", value, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkIn(List<String> values) {
            addCriterion("pch_remark in", values, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkNotIn(List<String> values) {
            addCriterion("pch_remark not in", values, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkBetween(String value1, String value2) {
            addCriterion("pch_remark between", value1, value2, "pchRemark");
            return (Criteria) this;
        }

        public Criteria andPchRemarkNotBetween(String value1, String value2) {
            addCriterion("pch_remark not between", value1, value2, "pchRemark");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}